home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol111 / help.lbr / HELP.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1986-12-15  |  24.1 KB  |  373 lines

  1. program help;
  2. var
  3.   command:string[20];
  4. const
  5.   crlf:string[2] = ^M^J;
  6.  
  7. type
  8.   text3   = string[3];
  9.   text8   = string[8];
  10.   text10  = string[10];
  11.   text20  = string[20];
  12.   text22  = string[22];
  13.   text40  = string[40];
  14.   text80  = string[80];
  15.   text128 = string[128];
  16.   text255 = string[255];
  17.   registers = record
  18.               AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags:integer;
  19.               end;
  20. var
  21.   filename,file1,file2  : text80;
  22.   reg         : registers;
  23.   str1,str2   : text20;
  24.   line40      : text40;
  25.   line80      : text80;
  26.   line128     : text128;
  27.   line255     : text255;
  28.   ch,ch1,ch2  : char;
  29.   i,j,k,l,m,n,x,y,z  : integer;
  30.   a,b,c,d            : real;
  31.  
  32.  
  33. (**********************************************************)
  34. (*  Function GETCMD                                       *)
  35. (*           ------                                       *)
  36. (*    calling sequence :         cmd := GetCmd            *)
  37. (*    returns :   next parameter from the command line.   *)
  38. (**********************************************************)
  39. function GetCmd : text80;
  40.   var
  41.     cmdlength:byte      absolute CSEG:$0080;
  42.     cmdline:string[126] absolute CSEG:$0081;
  43.   begin
  44.     GetCmd := ''; ch := ' '; i := 0;
  45.     if cmdlength>0 then           (* check if no more commands *)
  46.       begin
  47.         while ch = ' ' do         (* search cmdline for the first char *)
  48.           begin
  49.             i := i + 1;
  50.             ch := cmdline[i];
  51.             if (ch < ' ') or (ch = ',') then ch := ' ';
  52.             if ((i >= cmdlength) and (ch = ' ')) then ch := #$00;
  53.           end;
  54.  
  55.         if ch = #$00 then cmdlength := 0 else  (* cont if char found *)
  56.         begin
  57.           if i > 1 then delete(cmdline,1,i-1);
  58.           cmdlength := cmdlength - (i - 1);
  59.           i := 1;
  60.  
  61.           while ch <> ' ' do      (* find last char of this cmd *)
  62.             begin
  63.               i := i+1;
  64.               ch := cmdline[i];
  65.               if (ch < ' ') or (ch = ',') then ch := ' ';
  66.               if i > cmdlength then ch := ' ';
  67.             end;
  68.  
  69.           GetCmd := copy(cmdline,1,i-1);
  70.           cmdlength := cmdlength - (i - 1);
  71.           if cmdlength <> 0 then delete(cmdline,1,i-1);
  72.         end;
  73.       end;
  74.   end;
  75.  
  76.  
  77. {************************************************************}
  78. {*  Function READSECURE                                     *}
  79. {*           ----------                                     *}
  80. {*  calling sequence :            ReadSecure(instr);        *}
  81. {*                instr = string to be output to the screen *}
  82. {*  returns : a string containing a lineinput from the kbd. *}
  83. {*            there is no echo to the screen.               *}
  84. {************************************************************}
  85. function ReadSecure(instr:text128): text128;
  86. begin
  87.   write(instr);
  88.   ch := #00;    line128 := '';
  89.   read(KBD,ch);
  90.   while ch <> #$0D do                             { while no <cr> }
  91.     begin
  92.       i := length(line128);
  93.       if ch <> #$08 then                          { backspace ? }
  94.           insert(ch,line128,i+1)                 { add this char if not }
  95.         else
  96.           if i > 0 then delete(line128,i,1);     { delete last char if so}
  97.       if ch = #$1B then line128 := '';           { <esc> will startover }
  98.       read(KBD,ch);
  99.     end;
  100.   ReadSecure := line128;
  101.   if length(instr) > 0 then writeln;             { <cr> if line output }
  102. end;
  103.  
  104.  
  105. begin
  106.    writeln;
  107.    write  ('  HELP ');
  108.    textcolor(lightgray);
  109.    write  ('Ver2.03       ' );
  110.    textcolor(white);
  111.    write  ('M');
  112.    textcolor(lightgray);
  113.    write  ('agnum ');
  114.    textcolor(white);
  115.    write  ('C');
  116.    textcolor(lightgray);
  117.    write  ('ustom ');
  118.    textcolor(white);
  119.    write  ('S');
  120.    textcolor(lightgray);
  121.    writeln('oftware');
  122.    writeln;
  123.    command := getcmd;
  124.    if command = '' then
  125.       begin
  126.         writeln('  Help available for DOS commands:' );
  127.         writeln('      ASSIGN          DIR             IF              SET');
  128.         writeln('      BACKUP          DISKCOMP        MKDIR           SHELL');
  129.         writeln('      BREAK           DISKCOPY        MODE            SHIFT');
  130.         writeln('      BUFFERS         ECHO            MORE            SORT');
  131.         writeln('      CHDIR           ERASE           PATH            SYS');
  132.         writeln('      CHKDSK          EXE2BIN         PAUSE           TIME');
  133.         writeln('      CLS             FDISK           PRINT           TREE');
  134.         writeln('      COMP            FILES           PROMPT          TYPE');
  135.         writeln('      COPY            FIND            RECOVER         VER');
  136.         writeln('      CTTY            FOR             REM[REMARK]     VERIFY');
  137.         writeln('      DATE            FORMAT          REN[RENAME]     VOL');
  138.         writeln('      DEL             GOTO            RESTORE');
  139.         writeln('      DEVICE          GRAPHICS        RMDIR');
  140.         writeln;
  141.         writeln('  Extended help available for :' );
  142.         writeln('     /GENERAL        /DEBUG          /EXT            /FKEYS');
  143.         writeln('     /BATCH          /DIR            /FILTER         /DEV');
  144.         writeln('     /CONFIG         /EDLIN          /KEYS           /LINK');
  145.         inline($CD/$20);
  146.       end
  147.    else
  148.       begin
  149.         for i:=1 to length(command) do command[i]:=upcase(command[i]);
  150.         x:=wherex;
  151.         y:=wherey;
  152.         if command[1] <> '/' then
  153.           begin
  154.             if command = 'ASSIGN' then write('    ASSIGN [[x=y ]...]');
  155.             if command = 'BACKUP' then write('    BACKUP [d:][pathname][filespec] d:[/S][/M][/A][/D:mm-dd-yy]');
  156.             if command = 'BREAK'  then write('    BREAK [ON|OFF]');
  157.             if command = 'BUFFERS'then write('    BUFFERS =xx');
  158.             if command = 'CHDIR'  then write('    CHDIR [[d:]pathname]  or  CD [[d:]pathname]');
  159.             if command = 'CHKDSK' then write('    CHKDSK [d:][filespec][/F][/V]');
  160.             if command = 'CLS'    then write('    CLS');
  161.             if command = 'COMP'   then write('    COMP [d:][pathname][dilespec] [d:][pathname][filespec]');
  162.             if command = 'COPY'   then begin
  163.                                        write('    COPY [/A][/B][d:][pathname][source filespec]',
  164.                                        crlf, '         [/A][/B][d:][pathname][destination filespec][/A][/B][/V]',
  165.                                        crlf, '    or',
  166.                                        crlf, '    COPY [/A][/B][d:][pathname][source filespec][/A][/B]',
  167.                                        crlf, '         [+[d:][pathname]source filespec[/A][/B]...]',
  168.                                        crlf, '         [d:][pathname][destination filespec][/A][/B][/V]');
  169.                                        end;
  170.             if command = 'CTTY'     then write('    CTTY device');
  171.             if command = 'DATE'     then write('    DATE [mm-dd-yy]');
  172.             if command = 'DEL'      then write('    DEL [d:][pathname][filespec]');
  173.             if command = 'DEVICE'   then write('    DEVICE =[d:][pathname][filespec]');
  174.             if command = 'DIR'      then write('    DIR [d:][pathname][filespec][/P][/W]');
  175.             if command = 'DISKCOMP' then write('    DISKCOMP');
  176.             if command = 'DISKCOPY' then write('    DISKCOPY');
  177.             if command = 'ECHO'     then write('    ECHO');
  178.             if command = 'ERASE'    then write('    ERASE');
  179.             if command = 'EXE2BIN'  then write('    EXE2BIN');
  180.             if command = 'FDISK'    then write('    FDISK');
  181.             if command = 'FIND'     then write('    FIND [/V][/C][/N]"string"[ [d:][pathname][filespec]...]');
  182.             if command = 'FOR'      then write('    FOR %%c IN(set) DO command');
  183.             if command = 'FORMAT'   then write('    FORMAT [d:][/S][/1][/8][/V][/B]');
  184.             if command = 'GOTO'     then write('    GOTO label');
  185.             if command = 'GRAPHICS' then write('    GRAPHICS');
  186.             if command = 'IF'       then write('    IF [NOT] condition_command');
  187.             if command = 'MKDIR'    then write('    MKDIR [:d]pathname',crlf,
  188.                                                  '    or',crlf,
  189.                                                  '    MD [:d]pathname');
  190.             if command = 'MODE'     then write('    MODE LPT#:[n][,[m][,p]]');
  191.             if command = 'MORE'     then write('    MORE');
  192.             if command = 'PATH'     then write('    PATH [d:]pathname[[;[d:]pathname]...]');
  193.             if command = 'PAUSE'    then write('    PAUSE [comment]');
  194.             if command = 'PRINT'    then write('    PRINT [d:][filespec][/T][/C][/P][...]');
  195.             if command = 'PROMPT'   then write('    PROMPT [prompt_text]');
  196.             if command = 'RECOVER'  then write('    RECOVER d:[pathname][filespec]');
  197.             if (command = 'REM') or (command = 'REMARK')
  198.                                     then write('    REM [comment]');
  199.             if (command = 'REN') or (command = 'RENAME')
  200.                                     then write('    REN [d:][pathname]filespec filespec',crlf,
  201.                                                  '    or',crlf,
  202.                                                  '    RENAME [d:][pathname]filespec filespec');
  203.             if command = 'RESTORE'  then write('    RESTORE d: [d:][pathname][filespec][/S][/P]');
  204.             if command = 'RMDIR'    then write('    RMDIR [d:]pathname');
  205.             if command = 'SET'      then write('    SET [string1=[string2]]');
  206.             if command = 'SHELL'    then write('    SHELL =[d:][pathname]filespec');
  207.             if command = 'SHIFT'    then write('    SHIFT');
  208.             if command = 'SORT'     then write('    SORT [/R][/+n][filespec]');
  209.             if command = 'SYS'      then write('    SYS d:');
  210.             if command = 'TIME'     then write('    TIME [hh:mm[:ss[.cc]]]');
  211.             if command = 'TREE'     then write('    TREE [d:][/F]');
  212.             if command = 'TYPE'     then write('    TYPE [d:][pathname]filespec');
  213.             if command = 'VER'      then write('    VER');
  214.             if command = 'VERIFY'   then write('    VERIFY [ON|OFF]');
  215.             if command = 'VOL'      then write('    VOL [d:]');
  216.           end
  217.         else
  218.           begin
  219.             if command = '/GENERAL' then write('    GENERAL INFORMATION :',
  220.                                  crlf,crlf,  '    |[broken bar]         Used with an MS-DOS filter, indicates a pipe.',
  221.                                       crlf,  '    >[greater than]       Redirects output to a file.',
  222.                                       crlf,  '    >>                    Redirects output and adds it to an existing file.',
  223.                                       crlf,  '    <[less than]          Redirects input from a file.',
  224.                                       crlf,  '    *[wildcard]           Used for any number of chars in a filename or ext.',
  225.                                       crlf,  '    ?[question mark]      Used for any single char in a file spec.',
  226.                                  crlf,crlf,  '    FILESPEC CHARS        A-Z[upper or lower case]',
  227.                                       crlf,  '                          0-9',
  228.                                       crlf,  '                          $ ( ) & , - @',
  229.                                       crlf,  '                          # { } % ~ ! _');
  230.             if command = '/BATCH'   then write('    BATCH PROCESSING COMMANDS :',
  231.                                  crlf,crlf,  '    ECHO                  ECHO [ON|OFF|message]',
  232.                                       crlf,  '    FOR                   FOR %%c IN(set) DO command',
  233.                                       crlf,  '    GOTO                  GOTO label',
  234.                                       crlf,  '    IF                    IF [NOT] condition_command',
  235.                                       crlf,  '    PAUSE                 PAUSE [comment]',
  236.                                       crlf,  '    REMARK                REM [comment]',
  237.                                       crlf,  '    SHIFT                 SHIFT',
  238.                                       crlf,  '    Parameters            [%0 thru %9]');
  239.             if command = '/CONFIG'  then write('    CONFIGURATION COMMANDS :',
  240.                                  crlf,crlf,  '    ANSI.SYS              Device driver to change display options',
  241.                                       crlf,  '    BREAK                 BREAK ON|OFF',
  242.                                       crlf,  '    BUFFERS               BUFFERS =xx',
  243.                                       crlf,  '    DEVICE                DEVICE =[d:][pathname]filespec',
  244.                                       crlf,  '    FILES                 FILES =xx',
  245.                                       crlf,  '    SHELL                 SHELL =[d:][pathname]filespec');
  246.             if command = '/DEBUG'   then write('    DEBUG COMMANDS :',
  247.                                  crlf,crlf,  '    ASSEMBLE              A [address]',
  248.                                       crlf,  '    COMPARE               C range address',
  249.                                       crlf,  '    DUMP                  D [address [L value]]    or    D [range]',
  250.                                       crlf,  '    ENTER                 E address [list]',
  251.                                       crlf,  '    FILL                  F range list',
  252.                                       crlf,  '    GO                    G [=address] [address [address]]',
  253.                                       crlf,  '    HEX                   H value value',
  254.                                       crlf,  '    INPUT                 I address',
  255.                                       crlf,  '    LOAD                  L [address [d sector sector]',
  256.                                       crlf,  '    MOVE                  M range address',
  257.                                       crlf,  '    NAME                  N filespec [filespec][...]',
  258.                                       crlf,  '    OUTPUT                O address byte',
  259.                                       crlf,  '    QUIT                  Q',
  260.                                       crlf,  '    REGISTER              R [register_name]',
  261.                                       crlf,  '    SEARCH                S range list',
  262.                                       crlf,  '    TRACE                 T [=address] [value]',
  263.                                       crlf,  '    UNASSEMBLE            U [address] [l value]    or    U [range]',
  264.                                       crlf,  '    WRITE                 W [address [d sector sector]]');
  265.             if command = '/DIR'     then write('    DIRECTORY COMMANDS :',
  266.                                  crlf,crlf,  '    CHDIR                 CHDIR [d:][pathname]',
  267.                                       crlf,  '    DIR                   DIR [d:][pathname][filespec][/P][/W]',
  268.                                       crlf,  '    MKDIR                 MKDIR [d:][pathname]',
  269.                                       crlf,  '                          or',
  270.                                       crlf,  '                          MD [d:][pathname]',
  271.                                       crlf,  '    RMDIR                 RMDIR [d:][pathname]',
  272.                                       crlf,  '                          or',
  273.                                       crlf,  '                          RM [d:][pathname]',
  274.                                       crlf,  '    TREE                  TREE [d:][/F]');
  275.             if command = '/EDLIN'   then write('    EDLIN COMMANDS :',
  276.                                  crlf,crlf,  '    APPEND                [n] A',
  277.                                       crlf,  '    COPY                  [line],[line],line [,count]C',
  278.                                       crlf,  '    DELETE                [line][,line] D',
  279.                                       crlf,  '    EDIT                  [line]',
  280.                                       crlf,  '    END[EXIT]             E',
  281.                                       crlf,  '    INSERT                [line] I',
  282.                                       crlf,  '    LIST                  [line][,line] L',
  283.                                       crlf,  '    MOVE                  [line],[line],line M',
  284.                                       crlf,  '    PAGE                  [line][,line] P',
  285.                                       crlf,  '    QUIT                  Q',
  286.                                       crlf,  '    REPLACE               [line][,line][?] R[string1[^Zstring2]',
  287.                                       crlf,  '    SEARCH                [line][,line][?] Sstring',
  288.                                       crlf,  '    TRANSFER              [line] tfilespec',
  289.                                       crlf,  '    WRITE                 [n] W');
  290.             if command = '/EXT'     then write('    FILE SPECIFICATION EXTENSIONS :',
  291.                                  crlf,crlf,  '    .BAK                  Back-up file',
  292.                                       crlf,  '    .BAT                  Batch file',
  293.                                       crlf,  '    .BIN                  Default file extension (EXE2BIN)',
  294.                                       crlf,  '    .COM                  Command program (EXE2BIN)',
  295.                                       crlf,  '    .EXE                  Run (executable) file (MS-LINK, required)',
  296.                                       crlf,  '    .MAP                  List file (MS-LINK, optional)',
  297.                                       crlf,  '    .OBJ                  Object file (MS-LINK)',
  298.                                       crlf,  '    .LIB                  Library file (MS-LINK)',
  299.                                  crlf,crlf,  '    .PAS                  Pascal source file',
  300.                                       crlf,  '    .BAS                  Basic source file',
  301.                                       crlf,  '    .TXT                  Text file (ASCII)',
  302.                                       crlf,  '    .DAT                  Data file (binary or ASCII)',
  303.                                       crlf,  '    .SRC                  Misc. source file');
  304.             if command = '/FILTER'  then write('    FILTER COMMANDS :',
  305.                                  crlf,crlf,  '    FIND          FIND [/V][/C][/N]"string"[ [d:][pathname] filespec]...]',
  306.                                       crlf,  '    MORE          MORE',
  307.                                       crlf,  '    SORT          SORT [/R][/+n][filespec]');
  308.             if command = '/KEYS'    then write('    CONTROL KEY AND MULTIPLE-KEY FUNCTIONS :',
  309.                                  crlf,crlf,  '    CTRL(^)         Represented by a caret(^). Used with other keys.',
  310.                                       crlf,  '                    Some CTRL key functions are listed below.',
  311.                                       crlf,  '    ^ALT+DEL        Resets the system to the MS-DOS command level.',
  312.                                       crlf,  '    ^BREAK          Aborts current command.',
  313.                                       crlf,  '    ^NUM_LOCK       Temporarily suspends output to the screen (as when',
  314.                                       crlf,  '                    a file is being displayed). To continue, press any key.',
  315.                                       crlf,  '    ^PRTSC          Activates the printer. Prints lines as they are entered.',
  316.                                       crlf,  '                    Press ^PRTSC again to deactivate.',
  317.                                       crlf,  '    SHIFT+PRTSC     Each time they are pressed, causes the printer to print',
  318.                                       crlf,  '                    a hard copy of everything displayed on the screen.');
  319.             if command = '/FKEYS'   then write('    SPECIAL FUNCTION KEYS :',
  320.                                  crlf,crlf,  '    F1(Copy 1)      Copies one character from the template to the input',
  321.                                       crlf,  '                    buffer line. Functions like the CURSOR-RIGHT key.',
  322.                                       crlf,  '    F2(Copy To)     Copies all characters up to the specified character',
  323.                                       crlf,  '                    from the template to the input buffer line.',
  324.                                       crlf,  '    F3(Copy All)    Copies all characters from the template to the input',
  325.                                       crlf,  '                    buffer line.',
  326.                                       crlf,  '    DEL(Skip 1)     Skips over (deletes) the first character in the template',
  327.                                       crlf,  '                    line. Press F3 to see the results and copy the remainder',
  328.                                       crlf,  '                    of the line.',
  329.                                       crlf,  '    F4(Skip To)     Skips over characters in the template up to the specified',
  330.                                       crlf,  '                    character. Press F3 to see the results and copy the',
  331.                                       crlf,  '                    remainder of the line.',
  332.                                       crlf,  '    ESC(Skip All)   Voids the current input buffer line, leaving the',
  333.                                       crlf,  '                    template unchanged.',
  334.                                       crlf,  '    INS(Add In)     Turns the insert mode on. Allows characters to be insert-',
  335.                                       crlf,  '                    ed into a line. Pressing enter cancels the insert mode.',
  336.                                       crlf,  '    F5(New Temp)    Moves the cursor down one line, and makes this line',
  337.                                       crlf,  '                    the new template for further editing.',
  338.                                       crlf,  '    F6(^Z)          Ends the insert mode.',
  339.                                       crlf,  '    F7 thru F10     have no assigned function.');
  340.             if command = '/DEV'     then write('    RESERVED DEVICE NAMES :',
  341.                                  crlf,crlf,  '    AUX: or COM1:   Primary asynchronous communications adapter port.',
  342.                                       crlf,  '    COM2:           Secondary asynchronous communications adapter port.',
  343.                                       crlf,  '    CON:            Keyboard input and screen output.',
  344.                                       crlf,  '    PRN: or LPT1:   Line printer (output device only).',
  345.                                       crlf,  '    LPT2: or LPT3:  Additional line printers (output device only).');
  346.             if command = '/LINK'    then write('    MS-LINK INFORMATION :',
  347.                                  crlf,crlf,  '    Command Charaters :',
  348.                                       crlf,  '    +(plus sign)      Separates object modules to be linked.',
  349.                                       crlf,  '    or blank space',
  350.                                       crlf,  '    ;(semicolon)      Selects default responses to prompts after the',
  351.                                       crlf,  '                      first prompt.',
  352.                                       crlf,  '    ^BREAK            Aborts link session at any time.',
  353.                                       crlf,  '    /(slash)          Designates a switch.',
  354.                                  crlf,crlf,  '    Command Prompts : Libraries[.LIB]',
  355.                                       crlf,  '                      List File [NUL.MAP]',
  356.                                       crlf,  '                      Object Modules [.OBJ]',
  357.                                       crlf,  '                      Run File [object_file.EXE]',
  358.                                       crlf,  '                      Temporary Output File [VM.TMP]',
  359.                                  crlf,crlf,  '    Switches :        /DSALLOCATE         /HIGH',
  360.                                       crlf,  '                      /LINENUMBERS        /MAP',
  361.                                       crlf,  '                      /PAUSE              /STACK');
  362.           end;
  363.         if (x = wherex) and (y = wherey) then
  364.           writeln('    Help for ', command ,' not found')
  365.           else writeln;
  366.         inline($CD/$20);               { terminate the program }
  367.       end;
  368. end.
  369.  
  370.  
  371.  
  372.  
  373.